import 'package:json_annotation/json_annotation.dart';

part 'icon_model.g.dart';

@JsonSerializable()
class IconModel {
  @JsonKey(defaultValue: 0)
  final double width;
  @JsonKey(defaultValue: 0)
  final double height;
  @JsonKey(defaultValue: '')
  final String iconUrl;
  @JsonKey(defaultValue: false)
  final bool medal;
  @JsonKey(defaultValue: '')
  final String medalName;
  @JsonKey(defaultValue: '')
  final String medalUrl;

  const IconModel({
    required this.width,
    required this.height,
    required this.iconUrl,
    required this.medal,
    required this.medalName,
    required this.medalUrl,
  });

  factory IconModel.fromJson(Map<String, dynamic> json) =>
      _$IconModelFromJson(json);

  Map<String, dynamic> toJson() => _$IconModelToJson(this);
}